﻿using System;

namespace SharpOSCAR.Base
{
    /// <summary>
    /// Represents a Blob (byte array) data type
    /// </summary>
    public class Blob : ProtocolData
    {
        private byte[] _Value;
        /// <summary>
        /// Gets/sets the byte array value of the Blob
        /// </summary>
        public byte[] Value
        {
            get { return _Value; }
            set { _Value = value; }
        }

        /// <summary>
        /// Default constructor
        /// </summary>
        public Blob()
        { }

        /// <summary>
        /// Initializes the Blob with the specified value
        /// </summary>
        /// <param name="value">Value of the Blob</param>
        public Blob(byte[] value)
        {
            _Value = value;
        }

        /// <summary>
        /// Returns the value of the Blob
        /// </summary>
        /// <returns>Returns the value of the Blob</returns>
        public override byte[] ToByteArray()
        {
            return _Value;
        }
    }
}
